<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="layui/css/layui.css">
</head>

<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.5.1.min.js"></script>
<script src="layui/layui.js"></script>

<body>
<form class="layui-form" action="/pet/add">
    <input type="hidden" name="id" id="id">


    <div class="layui-form-item">
        <label class="layui-form-label">姓名</label>
        <div class="layui-input-block">
            <input type="text" name="petName" id="petName" required  lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-block">
            <input type="text" name="petType" id="petType" required  lay-verify="required" placeholder="请输入类型" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">血统</label>
        <div class="layui-input-block">
            <input type="text" name="petBreed" id="petBreed" required  lay-verify="required" placeholder="请输入血统" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">价格</label>
        <div class="layui-input-block">
            <input type="text" name="petPrice" required  lay-verify="required" placeholder="请输入价格" autocomplete="off" class="layui-input">
        </div>
    </div>

    <!--    <div class="layui-form-item">-->
    <!--        <div class="layui-inline">-->
    <!--            <label class="layui-form-label">持续时间</label>-->
    <!--            <div class="layui-input-inline">-->
    <!--                <input type="text" name="suretime" id="suretime" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">-->
    <!--            </div>-->
    <!--        </div>-->
    <!--    </div>-->

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            //layer.msg(JSON.stringify(data.field));
            return true;//true才会走action
        });
    });
</script>
</body>

<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

    });
</script>


</html>